<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>列表页面</title>
</head>
<body>
    <div style="width: 90%; margin: 0 auto">
        欢迎:${user.username}
        <a href="exit" onclick="return confirm('确定要退出吗?')">退出</a>
    </div>
    <table width="90%" border="1" align="center">
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>生日</th>
            <th>性别</th>
            <th>职业</th>
            <th>住所</th>
            <th>电话</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${pageBean.data}" var="profile">
            <tr>
                <td>${profile.id}</td>
                <td>${profile.name}</td>
                <td>
                <fmt:formatDate value="${profile.birthday}" pattern="yyyy-MM-dd"></fmt:formatDate>
                </td>
                <td>${profile.gender}</td>
                <td>${profile.career}</td>
                <td>${profile.address}</td>
                <td>${profile.mobile}</td>
                <td><img src="imageservlet?picture=${profile.picture}" width="100" height="50"></td>
                <td>
                    <input type="button" onclick="javascript:window.location.href='detail.jsp';" value="明细"/>
                    <a href="deletebook?id=${profile.id}" onclick="return confirm('确定要删除吗?')">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <div style="width: 90%; margin: 0 auto">
        <a href="${pageContext.request.contextPath}/profilelist?pageNum=1&pageSize=${pageBean.pageSize}">首页</a>
        <a href="${pageContext.request.contextPath}/profilelist?pageNum=${pageBean.pageNum-1}&pageSize=${pageBean.pageSize}">上一页</a>
        <a href="${pageContext.request.contextPath}/profilelist?pageNum=${pageBean.pageNum+1}&pageSize=${pageBean.pageSize}">下一页</a>
        <a href="${pageContext.request.contextPath}/profilelist?pageNum=${pageBean.pageCount}&pageSize=${pageBean.pageSize}">尾页</a>
    </div>
</body>
</html>
